package com.powernode.spring6;

import java.lang.reflect.Method;

public class ReflectTest {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("com.powernode.spring6.SystemService");
        Object obj = aClass.newInstance();
        Method loginMethod = aClass.getDeclaredMethod("login", String.class, String.class);
        Object retValue = loginMethod.invoke(obj, "admin", "admin123");
        System.out.println(retValue);
    }
}
